package com.yilin.tms.core.entity.system.system;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yilin.tms.core.commons.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "sys_app_version")
@TableName("sys_app_version")
public class AppVersion extends BaseEntity {
    public enum AppType {
        trucker(0, "车主端"),
        shipper(1, "货主端");
        @EnumValue
        public Integer index;
        public String name;

        AppType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    public enum SoftwareType {
        android(0, "安卓端"),
        ios(1, "IOS端");
        @EnumValue
        public Integer index;
        public String name;

        SoftwareType(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Column(name = "app_type")
    private AppType appType;
    @Column(name = "software_type")
    private SoftwareType softwareType;

    @Column(name = "plat_id")
    private String platId;
    @Column(name = "plat_name")
    private String platName;
    @Column(name = "product_code")
    private String productCode;
    //APP图标
    @Column(name = "app_icon",columnDefinition = "TEXT")
    private String appIcon;
    @Column(name = "version_title")
    private String versionTitle;
    @Column(name = "version_name")
    private String versionName;//v1.0.0
    @Column(name = "version_code")
    private Integer versionCode;//100
    @Column(name = "content")
    private String content;//1.xxx \n2.xxx
    @Column(name = "download_url")
    private String downloadUrl;
    @Column(name = "m_size")
    private Double mSize = 0D;
    @Column(name = "m_force")
    private Boolean mForce = false;

    //旧版本支持
    @Transient
    @TableField(exist = false)
    private String path;
    @Transient
    @TableField(exist = false)
    private Double size = 0D;
    @Transient
    @TableField(exist = false)
    private Boolean forceUpdate = false;

    public String getAppIcon() {
        return appIcon;
    }

    public void setAppIcon(String appIcon) {
        this.appIcon = appIcon;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public Double getSize() {
        return size;
    }

    public void setSize(Double size) {
        this.size = size;
    }

    public Boolean getForceUpdate() {
        return forceUpdate;
    }

    public void setForceUpdate(Boolean forceUpdate) {
        this.forceUpdate = forceUpdate;
    }

    public SoftwareType getSoftwareType() {
        return softwareType;
    }

    public void setSoftwareType(SoftwareType softwareType) {
        this.softwareType = softwareType;
    }

    public AppType getAppType() {
        return appType;
    }

    public void setAppType(AppType appType) {
        this.appType = appType;
    }

    public String getPlatId() {
        return platId;
    }

    public void setPlatId(String platId) {
        this.platId = platId;
    }

    public String getPlatName() {
        return platName;
    }

    public void setPlatName(String platName) {
        this.platName = platName;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getVersionTitle() {
        return versionTitle;
    }

    public void setVersionTitle(String versionTitle) {
        this.versionTitle = versionTitle;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    public Integer getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(Integer versionCode) {
        this.versionCode = versionCode;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public Double getmSize() {
        return mSize;
    }

    public void setmSize(Double mSize) {
        this.mSize = mSize;
    }

    public Boolean getmForce() {
        return mForce;
    }

    public void setmForce(Boolean mForce) {
        this.mForce = mForce;
    }
}

